﻿namespace TC
{
    public class Selector_tree : TranslateTree
    {
        public override editor.cfg.behaviourtree.TreeNode OnTranslate(Node node)
        {
            Selector t = node as Selector;
            editor.cfg.behaviourtree.Selector re = new editor.cfg.behaviourtree.Selector();
            re.id = t.id;

            Port p = null;
            foreach (var i in t.flows)
            {
                p = t.graph.GetConnect(i);
                if (p != null)
                {
                    re.nodes.Add(BTGraphExport.translate[p.parent.GetType()].OnTranslate(p.parent));
                }
            }
            return re;
        }
    }
}
